package com.ruoyi.web.controller.pay;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 统一下单实体
 */
@Data
@Valid
@ApiModel(value = "ToPayEntity")
public class ToPayEntity {

    @NotBlank(message = "付款方式不能为空")
    @Pattern(regexp = "^weChatPay|aliPay|weChatPayApp|weChatPayApplet$", message = "请提交指定付款方式")
    @ApiModelProperty(value = "微信支付填写“weChatPay”，支付宝支付填写“aliPay”，微信APP支付填写“weChatPayApp” ，微信小程序支付填写“weChatPayApplet”", position = 2, required = true)
    private String payChannels;

    @NotBlank(message = "付款金额不能为空")
    @Pattern(regexp = "(^[0-9](\\d+)?(\\.\\d{1,2})?$)|(^0$)|(^\\d\\.\\d{1,2}$)", message = "请提交正确付款金额")
    @ApiModelProperty(value = "付款金额，精确到小数点后两位。注：最小金额0.01元（不含手续费等其他附加费用的情况）", position = 4, required = true)
    private String payAmount;

    @NotBlank(message = "支付类型不能为空")
    @Pattern(regexp = "[1-3]", message = "请提交指定支付类型")
    @ApiModelProperty(value = "支付类型： 1-即时支付,2-担保支付,3-预授权支付", position = 5, required = true)
    private String apiPayType;

    @NotBlank(message = "渠道不能为空")
    @Pattern(regexp = "[1-2]", message = "请提交指定渠道")
    @ApiModelProperty(value = "渠道,1—充值，0—收款", position = 6, required = true)
    private String tradeType;

    @NotBlank(message = "订单标题不能为空")
    @ApiModelProperty(value = "订单标题", position = 9, required = true)
    private String orderSubject;

    @NotBlank(message = "商户订单号不能为空")
    @ApiModelProperty(value = "商户订单号", position = 26, required = true)
    private String merMerOrderNo;

    @NotBlank(message = "卖家双乾商户号不能为空")
    @ApiModelProperty(value = "子账户号,卖家双乾商户号", position = 1, required = true, hidden = true)
    private String sellerNo;

    @NotBlank(message = "分佣手续费金额不能为空")
    @Pattern(regexp = "(^[0-9](\\d+)?(\\.\\d{1,2})?$)|(^0$)|(^\\d\\.\\d{1,2}$)", message = "请提交正确分佣手续费金额")
    @ApiModelProperty(value = "分佣手续费金额,单位为元，精确到小数点后两位。注：最小金额0.01元", position = 12, required = true, hidden = true)
    private String commissionFee;

    @NotBlank(message = "分账商户号不能为空")
    @ApiModelProperty(value = "分账商户号", position = 14, required = true, hidden = true)
    private String routingMerNo;

    @NotBlank(message = "分账金额不能为空")
    @Pattern(regexp = "(^[0-9](\\d+)?(\\.\\d{1,2})?$)|(^0$)|(^\\d\\.\\d{1,2}$)", message = "请提交正确分账金额")
    @ApiModelProperty(value = "分账金额,单位为元，精确到小数点后两位", position = 15, required = true, hidden = true)
    private String routingFee;

    @NotBlank(message = "分佣商户号不能为空")
    @ApiModelProperty(value = "分佣商户号", position = 11, required = true, hidden = true)
    private String commissionMerNo;

    @ApiModelProperty(value = "订单信息,(如：Iphone手机一部)", position = 3, required = false, hidden = true)
    private String orderBody;

    @ApiModelProperty(value = "买家双乾商户号，交易类型为充值时，和卖家商户号保持一致，或者不填写", position = 7, required = false, hidden = true)
    private String buyerNo;

    @Pattern(regexp = "(^[0-9](\\d+)?(\\.\\d{1,2})?$)|(^0$)|(^\\d\\.\\d{1,2}$)", message = "请提交不参与优惠计算金额")
    @ApiModelProperty(value = "不参与优惠计算金额,单位为元，精确到小数点后两位", position = 8, required = false, hidden = true)
    private String undiscountableAmount;

    @ApiModelProperty(value = "三方分佣参数", position = 10, required = false, hidden = true)
    private String tempCommissionList;

    @ApiModelProperty(value = "集合,分账参数集合。Json串，例如：[{\"routingMerNo \":\"0000077\",\" routingFee \":\"0.01\"}]", position = 13, required = false, hidden = true)
    private String tempRoutingList;

    @ApiModelProperty(value = "商品列表,Json格式", position = 16, required = false, hidden = true)
    private String goodsDetail;

    @ApiModelProperty(value = "商品编号", position = 17, required = false, hidden = true)
    private String sqGoodsId;

    @ApiModelProperty(value = "商品名称", position = 18, required = false, hidden = true)
    private String goodsName;

    @ApiModelProperty(value = "商品数量", position = 19, required = false, hidden = true)
    private String quantity;

    @ApiModelProperty(value = "商品单价", position = 20, required = false, hidden = true)
    private String price;

    @ApiModelProperty(value = "商品类目", position = 21, required = false, hidden = true)
    private String goodsCategory;

    @ApiModelProperty(value = "商品描述信息", position = 22, required = false, hidden = true)
    private String body;

    @ApiModelProperty(value = "商品的展示地址", position = 23, required = false, hidden = true)
    private String showUrl;

    @ApiModelProperty(value = "微信openId", position = 24, required = false, hidden = true)
    private String openId;

    @ApiModelProperty(value = "平台承担手续费百分比", position = 25, required = false, hidden = true)
    private String ptUndertakeRate;
}
